<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<script type="text/javascript">
	function editDiray(){
		var form = document.getElementById("showForm") ;
		form.action = "${pageContext.request.contextPath}/diray?method=editUI" ;
		form.submit() ;
	}
	function deleteDiray(){
		if(confirm("您确定要删除这个日记吗？")){
			var form = document.getElementById("showForm") ;
			form.action = "${pageContext.request.contextPath}/diray?method=delete" ;
			form.submit() ;
		}
	}
</script>

<div class="data_list">
	<div class="data_list_title">
		<img
			src="${pageContext.request.contextPath}/images/diary_show_icon.png" />
		日记信息
	</div>
	<div>
		<form action="" method="post" id="showForm" name="showForm">
			<input type="hidden" name="dirayId" value="${diray.dirayId }">
			<div class="diary_title">
				<h3>${diray.dirayName }</h3>
			</div>
			<div class="diary_info">
				发布时间：『
				<fmt:formatDate value="${diray.releaseTime }" type="date"
					pattern="yyyy-MM-dd HH:mm:ss" />
				』&nbsp;&nbsp;日志类别：${diray.dirayType.dirayTypeName}
			</div>
			<div class="diary_content">${diray.content }</div>
			<div class="diary_action">
				<button class="btn btn-primary" type="button" onclick="editDiray()">修改日志</button>
				<button class="btn btn-primary" type="button"
					onclick="javascript:history.back()">返回</button>
				<button class="btn btn-danger" type="button" onclick="deleteDiray()">删除日志</button>
			</div>
		</form>
	</div>
</div>